class Test{
    private String name;
    private int id;
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public int getId() {
        return id;
    }
    public void setId(int id) {
        this.id = id;
    }
}

//class Student{
//    public String classroom = "301";
//    public  String name;
//    public  static String ID;
//
//    public Student(String name ,String classroom) {
//        this.name = name;
//        this.classroom = classroom;
//        System.out.println("调用了两个参数的构造方法");
//    }
//
//    static {  //静态构造块开始
//        ID = "202201006106";
//        System.out.println("调用了静态构造代码块");
//    }  //静态构造块结束
//
//    {  // 构造代码块开始
//        this.name = "zhang san";
//        this.classroom = "302";
//        System.out.println("调用了构造代码块");
//    }  // 构造代码块结束
//
//}
public class test_5_3 {
    public static void main(String[] args) {
//        Student s1 = new Student("小明", "501");
//        System.out.println(s1.name);
//        Student s2 = new Student("小张", "401");
//        System.out.println(s2.name);
    }
    public static void main2(String[] args) {
        Test s = new Test();
        s.setId(10);
        System.out.println(s.getId()); //10
    }
}
